
/*
 * Copyright 2002-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2015原作者。
 *
 *根据Apache许可证2.0版（“许可证”）许可；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，否则软件
 *根据许可证分发是在“按原样”的基础上分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证
 *许可证下的限制。
 */

package org.springframework.context.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.beans.factory.config.BeanDefinition;

/**
 * Indicates the 'role' hint for a given bean.
 *
 * <p>May be used on any class directly or indirectly annotated with
 * {@link org.springframework.stereotype.Component} or on methods
 * annotated with {@link Bean}.
 *
 * <p>If this annotation is not present on a Component or Bean definition,
 * the default value of {@link BeanDefinition#ROLE_APPLICATION} will apply.
 *
 * <p>If Role is present on a {@link Configuration @Configuration} class,
 * this indicates the role of the configuration class bean definition and
 * does not cascade to all @{@code Bean} methods defined within. This behavior
 * is different from the behavior of the @{@link Lazy} annotation, for example.
 *
 * @author Chris Beams
 * @since 3.1
 * @see BeanDefinition#ROLE_APPLICATION
 * @see BeanDefinition#ROLE_INFRASTRUCTURE
 * @see BeanDefinition#ROLE_SUPPORT
 * @see Bean
 */
/**
 *指示给定bean的“角色”提示。
 *
 *<p>可以直接或间接注释在任何类上
 *｛@link org.springframework.costereot.Component｝或方法上
 *用{@link Bean}注释。
 *
 *<p>如果组件或Bean定义上不存在此注释，
 *将应用{@link BeanDefinition#ROLE_APPLICATION}的默认值。
 *
 *<p>如果角色存在于｛@link Configuration@Configuration｝类上，
 *这指示了配置类bean定义和
 *不会级联到中定义的所有@｛@code-Bean｝方法。这种行为
 *与@{@link-Lazay}注释的行为不同。
 *
 *@作者Chris Beams
 *@自3.1起
 *@参见BeanDefinition#ROLE_APPLICATION
 *@参见BeanDefinition#ROLE_INFRASTRUCTURE
 *@参见BeanDefinition#ROLE_SUPPORT
 *@见憨豆
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Role {

	/**
	 * Set the role hint for the associated bean.
	 * @see BeanDefinition#ROLE_APPLICATION
	 * @see BeanDefinition#ROLE_INFRASTRUCTURE
	 * @see BeanDefinition#ROLE_SUPPORT
	 */
	/**
	 *为关联的bean设置角色提示。
	 *@参见BeanDefinition#ROLE_APPLICATION
	 *@参见BeanDefinition#ROLE_INFRASTRUCTURE
	 *@参见BeanDefinition#ROLE_SUPPORT
	 */
	int value();

}
